
package com.oscar.ehome.utils.util;

import android.content.Context;
import android.util.Log;
import android.widget.Toast;

import com.oscar.ehome.base.C;

/**
 * Toast工具类
 */
public class ToastUtil {

    public static void show(Context context, String info) {
        Toast.makeText(context, info, Toast.LENGTH_SHORT).show();
    }

    public static void show(Context context, int info) {
        Toast.makeText(context, info, Toast.LENGTH_LONG).show();
    }

    private static final String TAG = "LogUtils";

    private static final boolean LOGGER = C.Loger;

    public static void i(String tag, String msg) {
        if (LOGGER) {
            Log.i(TAG, tag + "-->" + msg);
        }
    }

    public static void w(String tag, String msg) {
        if (LOGGER) {
            Log.i(TAG, tag + "-->" + msg);
        }
    }

    public static void e(String tag, String msg) {
        if (LOGGER) {
            Log.e(TAG, tag + "-->" + msg);
        }
    }

    public static void e(String tag, String msg, Throwable tr) {
        if (LOGGER) {
            Log.w(TAG, tag + "-->" + msg + "  Throwable=" + tr.getMessage());
        }
    }
}
